<?php
	//ignore notices
	error_reporting (E_ALL ^ E_NOTICE);

	/*
	database name:
	argumen6_mainDatabase
	
	table name:
	argumentMaps
	
	user name:
	argumen6_lkjasld
	xvkL#KS%TE!4
	 
	columns:
	title, map 
	 */

	//get data from javascript save function
	//echo('hello php is working');
	
	$username="argumen6_lkjasld";
	$password="xvkL#KS%TE!4";
	$database="argumen6_mainDatabase";
	
	//connect to database
	//FIX ** this will have to be changed when uploaded
	$con = mysql_connect("127.0.0.1:3306",$username,$password);
	mysql_select_db($database, $con);

	
	//see if entry already exists	
	$result = mysql_query("SELECT title FROM argumentMaps");
	
	//echo("size of result" . mysql_num_rows($result) );
	
	$returnedTitles = array();
	
	while( $row = mysql_fetch_assoc($result) ){
		array_push($returnedTitles, $row['title'] );
	}
	//do something with results
	
	echo json_encode($returnedTitles);
	echo(mysql_error() );

	//***be sure to close after making the query
	mysql_close();
    //phpinfo();
    
?>